//Client should load Shared as well

include("shared.lua")

//Miss. Variables and Commands

function GM:Initialize( )
	surface.CreateFont("Tahoma", 16, 1000, true, false, "HUDFontAA")
end

//Elaborate, but more enthusiastic way of giving players a team...

function set_team()
 
local frame = vgui.Create( "DFrame" )
frame:SetPos( ScrH() / 2, ScrW() / 2 )
frame:SetSize( 120, 100 )
frame:SetTitle( "Change Team" )
frame:SetVisible( true )
frame:SetDraggable( true )
frame:ShowCloseButton( true )
frame:MakePopup()
 
team_1 = vgui.Create( "DButton", frame )
team_1:SetPos( 10, 25 ) 
team_1:SetSize( 100, 20 )
team_1:SetText( "Terrorists" )
team_1.DoClick = function()

    RunConsoleCommand( "team_1" )
 
end
 
team_2 = vgui.Create( "DButton", frame )
team_2:SetPos( 10, 45 ) 
team_2:SetSize( 100, 20 )
team_2:SetText( "Secret Service" )
team_2.DoClick = function()
	
    RunConsoleCommand( "team_2" )
 
end

team_3 = vgui.Create( "DButton", frame )
team_3:SetPos( 10, 65 ) 
team_3:SetSize( 100, 20 )
team_3:SetText( "President" )
team_3.DoClick = function()
	
    RunConsoleCommand( "team_3" )
 
end
 
end
concommand.Add( "team_menu", set_team )

function showhelp()

local help = vgui.Create( "DFrame" )
help:SetPos( ScrH() / 2, ScrW() / 2 )
help:SetSize( 400, 410 )
help:SetTitle( "Help" )
help:SetVisible( true )
help:SetDraggable( true )
help:ShowCloseButton( true )
help:MakePopup()

text = vgui.Create( "DLabel", help )
text:SetPos(10, 25)
text:SetSize(380, 360)
text:SetText([[Present Fear was developed by: Brandon Ragland; Gideon Travis 
In this gamemode, your objective is:

Terrorists: To kill the President, it is also good if you kill some of the secret service
however your main goal is to kill the President before the time runs out. If you don't
then the Secret Service and the President win! You are equiped with a SMG and a crowbar.

Secret Service: To protect the President from iminate danger of the frequent attacks by
Taliban, or the terrorists in this case. If the President is still alive and breathing by
the end of the round, then you and the President have completed and won the game! 

President: Use your Pistol, Crowbar, and Secret Service Agents to protect yourself from
death by the frequent Terrorist Attacks by the near by Taliban. Your main goal is to stay
alive until the clock runs out! If you do, you have Won the game!

Information: Once the game starts, you will have 5 minutes to seperate from the spawn. If
you don't, the round may only last 30 seconds, and admin will kick you, the game must be
played fair. When the counter starts, you will have 15 minutes to either protect the
President, or kill The President.]])

end
concommand.Add("gm_showhelp", showhelp)

//Draw Current Team Data

function GM:HUDPaintBackground()
end

function GM:HUDPaint()

	h = ScrH()
	w = ScrW()

	surface.SetDrawColor(255, 255, 255, 180)

	//Team Score Count
	local terrorist = 0
	local secret = 0
	local president = 0
	
	terrorist = team.GetScore( 1 )
	secret = team.GetScore( 2 )
	president = team.GetScore( 3 )

	draw.RoundedBox(16, 0, 0, 180, 50, Color(255, 255, 255, 120))
	draw.RoundedBox(16, 2, 2, 176, 46, Color(100, 100, 100, 120))
	local w05 = w * 0.05
	local h05 = h * 0.05
	surface.SetDrawColor(235, 235, 235, 255)
	draw.DrawText("Team Terrorist: "..terrorist, "HUDFontAA", 13, 3, Color(255, 0, 0, 255), TEXT_ALIGN_LEFT)
	draw.DrawText("Team Secret Service: "..secret, "HUDFontAA", 13, 18, Color(0, 255, 0, 255), TEXT_ALIGN_LEFT)
	draw.DrawText("Team President: "..president, "HUDFontAA", 13, 32, Color(0, 0, 255, 255), TEXT_ALIGN_LEFT)
end


